package com.jswlw.controller.api.helper;

import com.jswlw.controller.api.req.user.BindDevRequest;
import com.jswlw.entity.biz.DevUser;
import com.jswlw.entity.biz.Distributor;
import org.springframework.stereotype.Component;

/**
 * @author 吴维斌 E-mail:wuweibin0817@163.com
 * @version 创建时间：${date} ${time}
 */
@Component
public class DevUserHelper {

    public DevUser createDevUser(Integer userId, BindDevRequest request, Distributor distributor) {
        //绑定设备
        DevUser devUser = new DevUser();
        //
        devUser.setDistributorName(distributor.getName());
        devUser.setUserName(request.getUserName());
        devUser.setTel(request.getTel());
        devUser.setAddress(request.getAddress());
        devUser.setUserId(userId);
        return devUser;
    }
}
